package com.gitee.wsl.common.ui.ext.color

import androidx.compose.ui.graphics.Color
import androidx.compose.ui.util.lerp

fun Color.Companion.getColorForDays(days: Int): Color {
    if (days > 7) {
        return Color.Transparent
    }
    val maxDays = 7  // Maximum number of days (e.g., 7 days for yellow)
    val hueEnd = 60f  // Hue for yellow
    val hueStart = 30f  // Hue for orange
    val fraction = days.toFloat() / maxDays
    val hue = lerp(hueStart, hueEnd, fraction)
    val alpha = lerp(1f, 0f, fraction)
    val saturation = 0.8f
    val lightness = 0.5f
    return Color.hsl(hue = hue, saturation = saturation, lightness = lightness, alpha = alpha)
}